package com.whenjun.config.fastexcel;

import cn.idev.excel.converters.Converter;
import cn.idev.excel.metadata.GlobalConfiguration;
import cn.idev.excel.metadata.data.WriteCellData;
import cn.idev.excel.metadata.property.ExcelContentProperty;

public class MinutesToHoursConverter implements Converter<Integer> {

    @Override
    public WriteCellData<String> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        if (value == null) {
            return new WriteCellData<>("");
        }
        int hours = value / 60;
        int minutes = value % 60;
        return new WriteCellData<>(hours + "小时" + minutes + "分钟");
    }
}
